<?php namespace app\admin\controller;

class Webset extends Common {
    //动作
    public function index(){
	   $webmodel=new \system\model\Webset();
       if (IS_POST){
          foreach ($_POST['value'] as $k=>$v){
             if (!$v){
				message($k . '不能为空','back','error');
			 }
			 $webmodel->where('name',$k)->update(['value'=>$v]);
		  }
		  message('操作成功',u('index'),'success');
	   }
       $data=$webmodel->get()->toArray();
       View::with('data',$data);
	   return view();
    }
}
